<script setup lang="ts">
import { getDocument } from '@/api/auth/auth'
import { ref } from 'vue'
import { useRouter, useRoute } from 'vue-router'
//引入VueOfficeDocx组件
import VueOfficeDocx from '@vue-office/docx'
//引入相关样式
import '@vue-office/docx/lib/index.css'

const { push } = useRouter()
const route = useRoute()


const queryDocument = async () => {
  const data = await getDocument({
    documentId: '',
    documentType: 'fy'
  })
  console.log(data)
}
const loading = ref(true)
const time = ref(10)
setInterval(async () => {
  time.value -= 1
  if (time.value === 0) {
    loading.value = false
    return
  }
}, 1000)


const checked = ref(false)
const docxUrl = ref('')
docxUrl.value = route.query.docFileUrl as string
const rendered = () =>{
  console.log('渲染完成')
}
</script>

<template>
 <VueOfficeDocx :src="docxUrl" style="height: 100vh;" @rendered="rendered" />
</template>

<style scoped lang="less">
.documentBox {
  width: 100vw;
  padding: 16px;
  overflow: hidden;
  box-sizing: border-box;

  padding-bottom: 110px;
  .confirmBox{
    position: fixed;
    padding: 16px;
    bottom: 0;
    right: 0;
    left: 0;
    background-color: #fff;
  }
}
.documentWrapper {
  width: 100%;
}
</style>
